home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / mmailp.idb / usr / lib / Zmail / bin / sh-versions / audiocompose.z / audiocompose
Encoding:
Text File  |  1997-01-22  |  2.4 KB  |  82 lines

  1. :
  2. # Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
  3. # Permission to use, copy, modify, and distribute this material 
  4. # for any purpose and without fee is hereby granted, provided 
  5. # that the above copyright notice and this permission notice 
  6. # appear in all copies, and that the name of Bellcore not be 
  7. # used in advertising or publicity pertaining to this 
  8. # material without the specific, prior written permission 
  9. # of an authorized representative of Bellcore.  BELLCORE 
  10. # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
  11. # OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
  12. # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  13.  
  14. # Conversion from C shell to Bourne shell by Z-Code Software Corp.
  15. # Conversion Copyright (c) 1992 Z-Code Software Corp.
  16. # Permission to use, copy, modify, and distribute this material
  17. # for any purpose and without fee is hereby granted, provided
  18. # that the above copyright notice and this permission notice
  19. # appear in all copies, and that the name of Z-Code Software not
  20. # be used in advertising or publicity pertaining to this
  21. # material without the specific, prior written permission
  22. # of an authorized representative of Z-Code.  Z-CODE SOFTWARE
  23. # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
  24. # OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS",
  25. # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  26.  
  27. # This is to make metamail/showaudio do playback on the speaker, not the phone.
  28. AUDIOSPEAKERFORCE=1; export AUDIOSPEAKERFORCE
  29.  
  30. if test -d /usr/sony
  31. then
  32.     dev=/dev/sb0
  33. else
  34.     dev=/dev/audio
  35. fi
  36.  
  37. audiofile=$1
  38.  
  39. if test -f "$audiofile" -a -s "$audiofile"
  40. then
  41.     whatnext=1
  42. else
  43.     whatnext=0
  44. fi
  45.  
  46. while true
  47. do
  48.     if test $whatnext -eq 1
  49.     then
  50.         echo ""
  51.         echo "What do you want to do?"
  52.         echo ""
  53.         echo "1 -- Listen to recorded message"
  54.         echo "2 -- Replace with a new recording"
  55.         echo "3 -- All Done, Quit"
  56.         read which
  57.         case $which in
  58.             1) cat $audiofile > $dev ;;
  59.             2) whatnext=0 ;;
  60.             3) exit 0 ;;
  61.         esac
  62.     fi
  63.     echo-n "Press RETURN when you are ready to start recording: "
  64.     read foo
  65.  
  66.     trap "kill -9 $! > /dev/null 2>&1" 1 2 15
  67.     if test -z "$RECORD_AUDIO"
  68.     then
  69.         (/bin/cat < $dev > $audiofile) &
  70.     else
  71.         ($RECORD_AUDIO > $audiofile) &
  72.     fi
  73.     echo-n "press RETURN when you are done recording: "
  74.     read foo
  75.     echo One moment please...
  76.     /bin/sleep 1
  77.     echo-n Killing recording job...
  78.     /bin/kill -9 $! > /dev/null 2>&1
  79.     whatnext=1
  80. done
  81.